﻿using LiteFramework.Model;
using System.ServiceModel;

namespace LiteFramework.Contract
{
    [ServiceContract]
    public interface ILogonContract
    {
        /// <summary>
        /// 登陆。登陆成功将返回用户Token，返回null代表登陆不成功
        /// </summary>
        /// <param name="loginInfo"></param>
        /// <returns></returns>
        string Login(LoginInfo loginInfo);

        /// <summary>
        /// 登陆。登陆成功将返回用户Token，返回null代表登陆不成功
        /// </summary>
        /// <param name="loginInfo"></param>
        /// <returns></returns>
        LoginResult Login2(LoginInfo loginInfo);

        /// <summary>
        /// 注销
        /// </summary>
        [OperationContract]
        void Logout();

        /// <summary>
        /// 注销
        /// </summary>
        /// <param name="securityToken"></param>
        [OperationContract]
        void Logout(string securityToken);

        /// <summary>
        /// 注册
        /// </summary>
        /// <param name="regInfo"></param>
        /// <returns></returns>
        [OperationContract]
        RegResult Reg(RegInfo regInfo);

        /// <summary>
        /// 发送活动心跳信号。指示当前用户状态为【在线活动】，必要时可以调用此方法以避免用户长时间未操作数据导致的登陆超时问题
        /// </summary>
        [OperationContract]
        bool HeartBeat();
    }
}